import React, { Component } from "react";
import "../assets/css/Walk.css";
import {withRouter} from 'react-router-dom'
class Walk extends Component {
    constructor(props) {
        super(props)
    
        this.state = {
             slots:{}
        }
        this.ToMain = this.ToMain.bind(this)
    }

    ToMain(){
      this.props.history.push("/")
    }
    
  render() {
    var slot={}
    this.props.children.forEach(item=>{
        slot[item.props.slot] = item
    })
    return (
      <div className="walk">
        <div className="login_header">
          <div className="login_header_logo">
            <img
              className="login_header_logo_icon"
              src={require("../assets/images/home_active.png").default}
              alt=""
            />
            <span className="login_header_logo_text">Luckin Coffee</span>
          </div>
          <div className="login_header_walk" onClick={this.ToMain}>先逛一逛</div>
        </div>
        <div className="login_welcome">
          <div className="login_welcome_zh">{slot["main"]}</div>
          <div className="login_welcome_en">{slot["sub"]}</div>
        </div>
      </div>
    );
  }
}

export default withRouter(Walk);
